﻿namespace RavenDBTEst
{
    using System.Windows;

    using Raven.Client.Document;

    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MainWindow"/> class.
        /// </summary>
        public MainWindow()
        {
            this.InitializeComponent();

            var documentStore = new DocumentStore { Url = "http://localhost:8080/" };
            documentStore.Initialize();

            string companyId;
            using (var session = documentStore.OpenSession())
            {
                var entity = new Company { Name = "Company" };
                session.Store(entity);
                session.SaveChanges();
                companyId = entity.Id;
            }
        }
    }

    public class Company
    {
        public string Name { get; set; }

        public string Id { get; set; }
    }
}
